package gui;

import java.awt.Color;

import javax.swing.JLabel;
/**
 * JLabel which shows the user messages of the current usage.
 */
public class MessageLabel extends JLabel{

	/**
	 * Constructor of said JLabel.
	 * @param text is the text which is to be written at initialization.
	 */
	public MessageLabel(String text){
		super(text);
	}
	/**
	 * setMessage shows the specified message in either red or green.
	 * @param msg is the message to be shown.
	 * @param isError makes that if there is an error (isError==true) then it makes the text red, else it's green.
	 */
	public void setMessage(String msg, boolean isError){
		setForeground(isError?Color.RED:new Color(100,200,30));
		setText(msg);
	}
	
}
